www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\admindb\D_db_admin.asp

    <%


'**************************************************************
' 新动软网站管理系统
' 官方网站: http://www.aspcpu.com
' 系统作者: 阮丁远(网名:天下程序)
' Copyright 新动软网站管理系统 版权所有
'**************************************************************


%>





<LINK href="../css.css" type=text/css rel=stylesheet>
<%

dir_set="../../"


%>


<!--#include file=../../inc/conn.asp-->
<!--#include file=../../inc/Functionb.asp-->

<!--#include file=../../inc/ajaxLIB.asp-->

<!--#include file=../inc/checkadmin2.asp-->







<%
AJAXshowLoader()


%>




<%


if find_dataw("qitashezhi123","0",3)<>"1" and qx_if_max=0 then
response.redirect "../D_suodinguser.asp"
end if

%>









<style type="text/css"> 
<!-- 
body,td,th { 
font-size: 12px; 
} 
.STYLE1 { 
color: #FFFFFF; 
font-weight: bold; 
} 
.STYLE2 {color: #FF0000} 
--> 
</style><BODY topMargin=0 leftmargin="0" marginheight="0"> 
<% 

db1=main_data_mdb
If Request.QueryString("action")="back" Then 
currf="..\..\"&request.form("currf") 
currf=server.mappath(currf) 
backf="../../data/"&request.form("backf") 
backf=server.mappath(backf) 
backfy=request.form("backfy") 
On error resume next 
Set objfso = Server.CreateObject(fssoo_nd_var_str_x_customx) 

if err then 
err.clear 
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>" 
response.end 
end if 

if objfso.Folderexists(backf) = false then 
Set fy=objfso.CreateFolder(backf) 
end if 

objfso.copyfile currf,backf& "\"& backfy 
response.write "<script>alert(""备份数据库成功"");history.back();</script>" 
End If 

If Request.QueryString("action")="ys" Then 
currf=request.form("currf") 
currf = server.mappath(currf) 
ys=request.form("ys") 
Const JET_3X = 4 
strDBPath = left(currf,instrrev(currf,"\")) 
on error resume next 
Set objfso = Server.CreateObject(fssoo_nd_var_str_x_customx) 
if err then 
err.clear 
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>" 
response.end 
end if 

if objfso.fileexists(currf) then 
Set Engine = CreateObject("JRO.JetEngine") 
response.write strDBPath 
on error resume next 
If ys = "1" Then 
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & currf, _ 
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "tourtemp.mdb;" _ 
& "Jet OLEDB:Engine Type=" & JET_3X 
Else 
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & currf, _ 
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "tourtemp.mdb" 
End If 
objfso.CopyFile strDBPath & "tourtemp.mdb",currf 
objfso.DeleteFile(strDBPath & "tourtemp.mdb") 
Set objfso = nothing 
Set Engine = nothing 
if err then 
err.clear 
response.write "<script>alert(""错误:"&err.description&""");history.back();</script>" 
response.end 
end if 
response.write "<script>alert(""压缩数据库成功"");history.back();</script>" 
response.end 
Else 
response.write "<script>alert(""错误:找不到数据库文件!"");history.back();</script>" 
response.end 
End If 
end if 

if Request.QueryString("action")="reload" then 
currf="..\..\"&request.form("currf") 
currf=server.mappath(currf) 
backf="../../data/"&request.form("backf") 
if backf="" then 
response.write "<script>alert(""请输入您要恢复的数据库全名"");history.back();</script>" 
else 
backf=server.mappath(backf) 
end if 
on error resume next 
Set objfso = Server.CreateObject(fssoo_nd_var_str_x_customx) 
if err then 
err.clear 
response.write "<script>alert(""不能建立fso对象,请确保你的空间支持fso:!"");history.back();</script>" 
response.end 
end if 
if objfso.fileexists(backf) then 
objfso.copyfile ""&backf&"",""&currf&"" 
response.write "<script>alert(""恢复数据库成功"");history.back();</script>" 
response.end 
else 
response.write "<script>alert(""错误:备份目录下未找到您指定的备份文件,请检查文件名和路径是否填写正确!"");history.back();</script>" 
response.end 
end if 
end if 
%> 
<form name="form1" method="POST" action="D_db_admin.asp?action=back"> 
<div align="center"> 
<center> 
<table border="0" cellpadding="3" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber1" cellspacing="3"> 
<tr> 
<td width="100%" bgcolor="#330099"><span class="STYLE1">备份数据库</span></td> 
</tr> 
<tr> 
<td width="100%" bgcolor="#FBFDFF">要求空间支持FSO</td> 
</tr> 
<tr> 
<td width="100%" bgcolor="#FBFDFF">数据库路径: 
<span style="background-color: #F7FFF7"> 
<input type="text" name="currf" size="40" value="<%=db1%>" readonly>
</span> 备份数据目录:

 <span style="background-color: #F7FFF7"> 
 
 data/
<input type="text" name="backf" size="20" value="databakup"> 



</span></td> 
</tr> 
<tr> 

<%

Randomize '初始化随机数生成器。
rnddd = cstr(clng(Rnd(255)*99999))&cstr(clng(Rnd(255)*99999)+100) '产生随机数

%>


<td width="100%" bgcolor="#FBFDFF">数据库名称:<span style="background-color: #F7FFF7"> 
<input type="text" name="backfy" size="40" value="backup-<%=year(date())%>-<%=month(date())%>-<%=day(date())%>-<%=hour(now())%>-<%=Minute(now())%>_<%=rnddd%>.mdb"> 

<input type="submit" name="Submit" value="备份" > 
<span class="STYLE2">注:尽量不要更改以上项</span></span></td> 
</tr> 
</table> 
</center> 
</div> 
</form> 
<form name="form1" method="POST" action="D_db_admin.asp?action=reload"> 
<div align="center"> 
<center> 
<table border="0" cellpadding="3" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber3"> 
<tr> 
<td width="100%" bgcolor="#330099"> 
<span class="STYLE1">恢复数据库</span></td> 
</tr> 
<tr> 
<td width="100%">要求空间支持FSO</td> 
</tr> 
<tr> 
<td width="100%">当前数据库路径:<span style="background-color: #F7FFF7"> 
<input type="text" name="currf" size="40" value="<%=db1%>" readonly> 
</span> 备份数据库路径:<span style="background-color: #F7FFF7"> 

data/
<input type="text" name="backf" size="20" value="databakup/backup.mdb">


</span> <span style="background-color: #F7FFF7"> 
<input type="submit" name="Submit" value="恢复" > 
</span> 
</td> 
</tr> 
</table> 
</center> 
</div> 
</form>





<%
AJAXcloseLoader()
%>